﻿namespace Fiddler.AMF
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class AmfRequestInspector : Inspector2, IRequestInspector2
    {
        private AMFViewer viewer = new AMFViewer();

        private byte[] bytes;

        public HTTPRequestHeaders headers
        {
            get
            {
                return null;
            }

            set
            {
            }
        }

        public void Clear()
        {
        }

        public bool bDirty { get; private set; }

        public bool bReadOnly { get; set; }

        public byte[] body 
        {
            get
            {
                return this.bytes;
            }

            set 
            {
                this.bytes = value;
                this.viewer.DisplayRequest(value); 
            } 
        }

        public override void AddToTab(System.Windows.Forms.TabPage o)
        {
            o.Text = "AMF";
            o.Controls.Add(this.viewer);
        }

        public override int GetOrder()
        {
            return 0;
        }
    }
}
